<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>使用?<!断言排除法统一数据</title>
  </head>
  <body>
    <main>
      <a href="https://www.houdunren.com/1.jpg">1.jpg</a>
      <a href="https://oss.houdunren.com/2.jpg">2.jpg</a>
      <a href="https://cdn.houdunren.com/3.jpg">3.jpg</a>
      <a href="https://houdunren.com/4.jpg">4.jpg</a>
    </main>
  </body>
  <script>
    //?<!
    const main = document.querySelector("main");
    const reg = /https:\/\/([a-z]+)?(?<!oss)\..+?(?=\/)/gi;
    main.innerHTML = main.innerHTML.replace(reg, (v) => {
      return `https://oss.houdunren.com`;
    });
  </script>
</html>
